package com.zbd.microservices.web.rest;

import javax.inject.Inject;

import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.codahale.metrics.annotation.Timed;
import com.zbd.microservices.domain.Authority;
import com.zbd.microservices.security.AuthoritiesConstants;
import com.zbd.microservices.service.AuthorityService;

/**
 * 微服务权力控制器
 * 没做页面的不用找了
 * @author D
 */
@RestController
public class AuthorityResource {
    @Inject
    private AuthorityService authorityService;
    
	@PostMapping("/createAuthority")
	@Timed
	public Authority createAuthority(Authority authority) {
		return authorityService.createAuthority(authority);
	}
	
	@PostMapping("/deleteAuthority")
	@Timed
	public String deleteAuthority(Authority authority) {
		authorityService.delAuthority(authority);
		 return "done";
	}
	

}
